Skip to content

fix: correct drop-shadow output format and filter function bugs#309

Merged
danstepanov merged 1 commit intonativewind:mainfrom
YevheniiKotyrlo:fix/filter-drop-shadow-fixes
Mar 26, 2026
Merged

fix: correct drop-shadow output format and filter function bugs#309
danstepanov merged 1 commit intonativewind:mainfrom
YevheniiKotyrlo:fix/filter-drop-shadow-fixes

Conversation

@YevheniiKotyrlo
Copy link
Copy Markdown
Contributor

Summary

Three fixes in src/native/styles/functions/filters.ts:

1. blurRadiusstandardDeviation in drop-shadow handler

React Native's DropShadowValue type expects standardDeviation, not blurRadius:

export type DropShadowValue = {
  offsetX: number | string;
  offsetY: number | string;
  standardDeviation?: number | string;
  color?: ColorValue | number;
};

The handler was producing { blurRadius: 6 } — React Native ignores this unrecognized property, resulting in drop shadows with zero blur.

2. ["color", "string"]["color", "color"] in drop-shadow handler

The "string" type in the shorthand handler rejects platform color objects (from currentcolor resolution). box-shadow.ts and text-shadow.ts both correctly use ["color", "color"] — this aligns the drop-shadow handler.

3. hueRotateopacity in opacity filter function (copy-paste)

The opacity function returned { hueRotate: ... } instead of { opacity: ... } — copied from the hueRotate function above it.

Changes

File Change
src/native/styles/functions/filters.ts All 3 fixes (+6/-6 lines)
src/__tests__/native/filters.test.tsx New: 7 native runtime tests for drop-shadow + opacity
src/__tests__/vendor/tailwind/filters.test.tsx Update: blurRadiusstandardDeviation in existing assertions

Test plan

  • npx jest src/__tests__/native/filters.test.tsx — 7 tests pass (drop-shadow basic, color-first, no-blur, CSS variable, runtime variable, Tailwind v4 @Property pattern, opacity key)
  • npx jest src/__tests__/vendor/tailwind/filters.test.tsx — 24 tests pass (existing, assertions updated)
  • Full suite: 995 passed, 29 failed (pre-existing babel test failures, same on main)
  • tsc --noEmit — clean
  • eslint — clean

@YevheniiKotyrlo YevheniiKotyrlo force-pushed the fix/filter-drop-shadow-fixes branch 2 times, most recently from 3d5024b to 9b87ebe Compare March 20, 2026 18:32
@danstepanov danstepanov moved this to Todo in Roadmap Mar 26, 2026
@danstepanov danstepanov force-pushed the fix/filter-drop-shadow-fixes branch from 9b87ebe to 80ff5ee Compare March 26, 2026 22:14
@danstepanov danstepanov merged commit 99859a4 into nativewind:main Mar 26, 2026
6 checks passed
@github-project-automation github-project-automation bot moved this from Todo to Done in Roadmap Mar 26, 2026
@danstepanov danstepanov moved this from Done to Ready for Release in Roadmap Mar 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Ready for Release

Development

Successfully merging this pull request may close these issues.

2 participants